{template 'common/header'}
<ul class="nav nav-tabs">
	<li {if $operation == 'display'}class="active"{/if}><a href="{php echo $this->createWebUrl('teamjiang')}">团队奖管理</a></li>
	{if $operation == 'detail'}
		<li class="active"><a href="#">团队奖详情</a></li>
	{/if}
</ul>
{if $operation == 'display'}
<div class="main">
	<div class="panel panel-info">
		<div class="panel-heading">筛选</div>
		<div class="panel-body">
			<form action="./index.php" method="get" class="form-horizontal" role="form" id="form1">
				<input type="hidden" name="c" value="site" />
				<input type="hidden" name="a" value="entry" />
				<input type="hidden" name="m" value="cy163_salesjl" />
				<input type="hidden" name="do" value="teamjiang" />
				<div class="form-group">
					<div class="col-sm-5 col-xs-12">
						<select name="hdid" class="form-control">
							<option value="0">--请选择一档活动--</option>
							{loop $huodonglist $row}
							<option value="{$row['id']}" {if $row['id'] == $_GPC['hdid']}selected="selected"{/if}>{$row['title']}{if $row['hasteamjiang']}(已结算团队奖){/if}</option>
							{/loop}
						</select>
					</div>
					<div class="col-sm-7 col-xs-12">
						<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
					</div>
				</div>
			</form>
		</div>
	</div>
	{if $teamlist}
	<div class="panel panel-default">
		<div class="panel-heading">团队奖结算</div>
		<div class="panel-body table-responsive">
			<table class="table table-hover">
				<thead class="navbar-inner">
				<tr>
					<th style="width:20%;">团队名称</th>
					<th style="width:10%;">代理价总额</th>
					<th style="width:10%;">销售价总额</th>
					<th style="text-align:right;">操作</th>
				</tr>
				</thead>
				<tbody>
				{loop $teamlist $row}
					<tr>
						<td>{$row['name']} </td>
						<td>{$row['alldailiprice']}</td>
						<td>{$row['allsalesprice']}</td>
						<td style="text-align:right;">
							<a href="{php echo $this->createWebUrl('teamjiang',array('op'=>'detail','hdid'=>$hdid,'fopenid'=>$row['openid']))}" class="btn btn-sm btn-info">查看详情</a>
						</td>
					</tr>
				{/loop}
				</tbody>
			</table>
		</div>
	</div>
	{/if}
</div>

{elseif $operation == 'detail'}
<div class="main">
	{if $teamlist}
	<div class="panel panel-default">
		<div class="panel-heading">团队奖结算</div>
		<div class="panel-body table-responsive">
			<table class="table table-hover">
				<thead class="navbar-inner">
				<tr>
					<th style="width:20%;">团员名称</th>
					<th style="width:10%;">级别</th>
					<th style="width:10%;">代理价总额</th>
					<th style="width:10%;">代理价奖励比例</th>
					<th style="width:10%;">代理价奖励总额</th>
					<th style="width:10%;">销售价销售总额</th>
					<th style="width:10%;">销售价奖励比例</th>
					<th style="width:10%;">销售价奖励总额</th>
					<th style="text-align:right;">操作</th>
				</tr>
				</thead>
				<tbody>
				{loop $teamlist $row}
					<tr>
						<td>{$row['realname']} </td>
						<td><span class="label label-info">{if $row['openid'] == $fopenid}团长{else}团员{/if}</span></td>
						<td>{$row['dailiprice']}</td>
						<td>{$bili}%</td>
						<td>{if $row['openid'] == $fopenid}{$tzyj1}{else}{$row['jiang']}{/if}</td>
						<td>{$row['saleprice']}</td>
						<td>{$bili2}%</td>
						<td>{if $row['openid'] == $fopenid}{$tzyj2}{else}{$row['jiang2']}{/if}</td>
						<td style="text-align:right;">
	
						</td>
					</tr>
				{/loop}
				</tbody>
			</table>
		</div>
	</div>
	{/if}
</div>
{/if}
{template 'common/footer'}